<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center my_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub my_fd0_0'>
          <view class='flex flex-wrap align-center my_fd0_0_c0'>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='my_fd0_0_c1_c0'>个人中心</text>
          </view>
          <view class='flex flex-wrap align-center justify-end my_fd0_0_c0'>
            <view class='flex flex-wrap align-center my_fd0_0_c2_c0' @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/tabBar/myNews/myNews`">
              <image class='my_fd0_0_c2_c0_c0' mode="aspectFit" :src='STATIC_URL+"27.png"'></image>
              <benben-message-num class='my_fd0_0_c2_c0_c1' :message-num="subscripts.all" size='24' color='#FFFFFF'
                background-color='#F02325'>
              </benben-message-num>
            </view>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>

      <view class="flex flex-wrap align-start benben-flex-layout my_flex_1">
        <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
          <view class='flex flex-wrap align-center' v-if="isLogin===true">
            <image class='my_fd1_0_c0_c0' mode="aspectFill" :src='userInfo.avatar'
              @tap.stop="singleImagePreview(userInfo.avatar)"></image>
            <view class='flex flex-direction flex-wrap align-stretch flex-sub my_fd1_0_c0_c1' @tap.stop="handleJumpDiy"
              data-type="navigateTo" :data-url="`/pages/grzx/personalData/personalData`">
              <text class='my_fd1_0_c0_c1_c0'>{{userInfo.nickname}}</text>
            </view>
            <image class='my_fd1_0_c0_c2' mode="aspectFit" :src='STATIC_URL+"29.png"' @tap.stop="handleJumpDiy"
              data-type="navigateTo" :data-url="`/pages/grzx/personalData/personalData`"></image>
          </view>
          <!-- v-if="isLogin===false" -->
          <view class='flex flex-wrap align-center' @tap.stop="toLoginDiy()" v-else>
            <image class='my_fd1_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"5.png"'></image>
            <view class='flex flex-direction flex-wrap align-stretch flex-sub my_fd1_0_c0_c1'>
              <view class='flex flex-wrap align-center'>
                <text class='my_fd1_0_c0_c1_c0'>请登录</text>
              </view>
            </view>
          </view>

        </view>
      </view>



      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout my_flex_2">
        <view class='flex flex-wrap align-center self-center justify-around my_fd2_0'>
          <view class='flex flex-wrap align-center self-center justify-center my_fd2_0_c0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/sc/myCollections/myCollections`">
            <image class='my_fd2_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"148.png"'></image>
            <text class='my_fd2_0_c0_c1'>收藏</text>
            <text>{{userInfo.collectCount}}</text>
          </view>

          <view class='flex  my_fd2_0_c1'></view>

          <view class='flex flex-wrap align-center self-center justify-center my_fd2_0_c0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/zj/myTrack/myTrack`">
            <image class='my_fd2_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"149.png"'></image>
            <text class='my_fd2_0_c0_c1'>足迹</text>
            <text>{{userInfo.zujiCount}}</text>
          </view>
        </view>
      </view>


      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center">
        <view class='flex flex-direction flex-wrap align-stretch flex-sub my_fd3_0'>
          <view class='flex flex-direction flex-wrap align-stretch flex-sub my_fd3_0_c0'>
            <view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/grzx/wodefabu/wodefabu`">
              <image class='my_fd3_0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"30.png"'></image>
              <view class='flex flex-wrap align-center justify-between flex-sub my_fd3_0_c0_c0_c1'>
                <text class='my_fd3_0_c0_c0_c1_c0'>我的发布</text>
                <image class='my_fd3_0_c0_c0_c1_c1' mode="aspectFit" :src='STATIC_URL+"11.png"'></image>
              </view>
            </view>
            <view class='flex flex-wrap align-center' v-if="isLogin" @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/grzx/shenqingliebiao/shenqingliebiao`">
              <image class='my_fd3_0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"31.png"'></image>
              <view class='flex flex-wrap align-center justify-between flex-sub my_fd3_0_c0_c0_c1'>
                <text class='my_fd3_0_c0_c0_c1_c0'>{{userInfo.leixing=='0' ? '我的申请' : '申请列表'}}</text>
                <image class='my_fd3_0_c0_c0_c1_c1' mode="aspectFit" :src='STATIC_URL+"11.png"'></image>
              </view>
            </view>
            <view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/xtsz/kefu/kefu`">
              <image class='my_fd3_0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"72.png"'></image>
              <view class='flex flex-wrap align-center justify-between flex-sub my_fd3_0_c0_c0_c1'>
                <text class='my_fd3_0_c0_c0_c1_c0'>联系我们</text>
                <image class='my_fd3_0_c0_c0_c1_c1' mode="aspectFit" :src='STATIC_URL+"11.png"'></image>
              </view>
            </view>
            <view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/grzx/yaoqinghaoyou/yaoqinghaoyou`">
              <image class='my_fd3_0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"33.png"'></image>
              <view class='flex flex-wrap align-center justify-between flex-sub my_fd3_0_c0_c0_c1'>
                <text class='my_fd3_0_c0_c0_c1_c0'>分享平台</text>
                <image class='my_fd3_0_c0_c0_c1_c1' mode="aspectFit" :src='STATIC_URL+"11.png"'></image>
              </view>
            </view>
            <view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/xtsz/system/system`">
              <image class='my_fd3_0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"147.png"'></image>
              <view class='flex flex-wrap align-center justify-between flex-sub my_fd3_0_c0_c3_c1'>
                <text class='my_fd3_0_c0_c0_c1_c0'>系统设置</text>
                <image class='my_fd3_0_c0_c0_c1_c1' mode="aspectFit" :src='STATIC_URL+"11.png"'></image>
              </view>
            </view>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},


    data() {
      return {
        "userInfo": {
          "invite_code": "",
          "address": "",
          "address_code": "",
          "hobby": "",
          "tags": "",
          "id": "",
          "userlevel_id": "",
          "mobile": "",
          "real_name": "",
          "avatar": "",
          "account": "",
          "email": "",
          "birthday": "",
          "gender": "",
          "create_time": "",
          "user_money": "",
          "freeze_money": "",
          "total_consumption_money": "",
          "score": "",
          "_mobile": "",
          "coupon": "",
          "collection_count": "",
          "browse_count": "",
          "total_money": "",
          "certified": "",
          "nickname": "",
          "is_pay_password": "",
          "follow_count": "",
          "is_close": ""
        },
        "subscripts": {
          "article": "",
          "message": "",
          "chat": "",
          "all": ""
        }
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },
      isLogin() {
        return this.$store.state.token == '' ? false : true;
      }
    },
    watch: {},
    onLoad(options) {

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      if (this.isLogin === true) {
        this.queryUserInfoFunc()
        this.obtainMessagesFunc()
      }

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //获取用户详细信息
      async queryUserInfoFunc() {
        if (this.isLogin === true) {
          //请求方法
          //数据验证

          let datauserInfo = await this.$api.get(global.apiUrls.post5c78c4772da97, {

          });

          if (datauserInfo.data.code != 1) {
            this.$message.info(datauserInfo.data.msg);
            return
          }
          let infouserInfo = datauserInfo.data;
          this.userInfo = infouserInfo.data

        }
      },
      //获取消息数量
      async obtainMessagesFunc() {
        //请求方法
        //数据验证

        let datasubscripts = await this.$api.get(global.apiUrls.post64241ca6cf066, {

        });

        if (datasubscripts.data.code != 1) {
          this.$message.info(datasubscripts.data.msg);
          return
        }
        let infosubscripts = datasubscripts.data;
        this.subscripts = infosubscripts.data

      },
      //是否认证跳转
      // isAuthenticationFunc() {
      //   if (this.userInfo.certified == '-1') {
      //     this.$urouter.navigateTo(`/pages/grzx/realname/realname`);
      //   } else {
      //     this.$urouter.navigateTo(`/pages/grzx/examine/examine`);
      //   }
      // }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: url(image-path('36.png')) no-repeat;
    background-size: 100% 400rpx;
  }

  .my_flex_0 {
    background: url(image-path('36.png')) no-repeat;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .my_fd0_0_c2_c0_c1 {
    position: absolute;
    top: -15rpx;
    right: -15rpx;
  }

  .my_fd0_0_c2_c0_c0 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .my_fd0_0_c2_c0 {
    position: relative;
  }

  .my_fd0_0_c1_c0 {
    font-size: 32rpx;
    color: var(--benbenFontColor3);
  }

  .my_fd0_0_c0 {
    width: 200rpx;
  }

  .my_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .my_flex_1 {
    padding: 24rpx 32rpx 30rpx 32rpx;
  }

  .my_fd1_0_c0_c2 {
    width: 14rpx;
    height: 26rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .my_fd1_0_c0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #FFFFFF;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .my_fd1_0_c0_c1 {
    margin: 0rpx 0rpx 0rpx 20rpx;
  }

  .my_fd1_0_c0_c0 {
    width: 128rpx;
    height: 128rpx;
    border-radius: 66rpx 66rpx 66rpx 66rpx;
  }

  .my_flex_2 {
    padding: 40rpx 24rpx 0rpx 24rpx;
  }

  .my_fd2_0_c1 {
    background: rgba(230, 230, 230, 1);
    width: 4rpx;
    height: 40rpx;
    margin: 0rpx 10rpx 0rpx 10rpx;
    transform: scaleX(0.5);
  }

  .my_fd2_0_c0_c1 {
    margin: 0rpx 10rpx 0rpx 10rpx;
  }

  .my_fd2_0_c0_c0 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .my_fd2_0_c0 {
    line-height: 40rpx;
  }

  .my_fd2_0 {
    background: #fff;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    background-size: 100% auto !important;
    padding: 32rpx 24rpx 32rpx 24rpx;
  }

  .my_fd3_0_c0_c3_c1 {
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .my_fd3_0_c0_c0_c1_c1 {
    width: 14rpx;
    height: 26rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .my_fd3_0_c0_c0_c1_c0 {
    margin: 0rpx 16rpx 0rpx 16rpx;
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
  }

  .my_fd3_0_c0_c0_c1 {
    border-bottom: 1px solid #eee;
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .my_fd3_0_c0_c0_c0 {
    width: 32rpx;
    height: 32rpx;
  }

  .my_fd3_0_c0 {
    background: var(--benbenbgColor1);
    margin: 24rpx 0rpx 24rpx 0rpx;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    background-size: 100% auto !important;
    padding: 0rpx 24rpx 0rpx 24rpx;
  }

  .my_fd3_0 {
    padding: 0rpx 24rpx 0rpx 24rpx;
  }
</style>
